package com.qianxing.utils;

/**
 * @Author:JasonLong
 * @Date:2023/7/7
 * @Time:9:36 线程变量工具类
 */
public class ThreadLocalUtils<T> {

    private final ThreadLocal<T> tl = new ThreadLocal<>();

    public void saveData(T data) {
        tl.set(data);
    }

    public T getData() {
        return tl.get();
    }

    public void removeData() {
        tl.remove();
    }
}
